package com.team.utils.util_wx.bean;

import com.team.utils.util_wx.common.Configure;
import com.team.utils.util_wx.common.RandomStringGenerator;
import com.team.utils.util_wx.common.Signature;

/**
 * App 调起支付需要的请求参数
 */
public class AppPayParams {
	private String appid;
	private String partnerid;
	private String prepayid;
	private String _package;
	private String noncestr;
	private String timestamp;
	private String sign;

	public AppPayParams(String prepayid) throws IllegalAccessException {
		this.appid = Configure.getAppid();
		this.partnerid = Configure.getMchid();
		this.prepayid = prepayid;
		// 暂填
		this._package = "Sign=WXPay";
		this.noncestr = RandomStringGenerator.getRandomStringByLength(32);
		this.timestamp = System.currentTimeMillis() / 1000 + "";
		this.sign = Signature.getSign(this);
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getPartnerid() {
		return partnerid;
	}

	public void setPartnerid(String partnerid) {
		this.partnerid = partnerid;
	}

	public String getPrepayid() {
		return prepayid;
	}

	public void setPrepayid(String prepayid) {
		this.prepayid = prepayid;
	}

	public String get_package() {
		return _package;
	}

	public void set_package(String _package) {
		this._package = _package;
	}

	public String getNoncestr() {
		return noncestr;
	}

	public void setNoncestr(String noncestr) {
		this.noncestr = noncestr;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	@Override
	public String toString() {
		return "AppPayParams{" + "appid='" + appid + '\'' + ", partnerid='" + partnerid + '\'' + ", prepayid='"
				+ prepayid + '\'' + ", _package='" + _package + '\'' + ", noncestr='" + noncestr + '\''
				+ ", timestamp='" + timestamp + '\'' + ", sign='" + sign + '\'' + '}';
	}
}
